<template>
  <div class="mx-container">
    <zz-sub-nav :list="list" :index.sync="index">
      <div class="sub-nav-content">
        <div>
          <div class="details-title">{{ $t("zz.access_scenario") }}</div>
          <zz-card>
            <p slot="content">{{ $t("zz.realTime.vod.intro") }}</p>
            <img
              :src="$t('zz.img.bunchPlanting1-1')"
              slot="img"
              alt=""
              width="480"
            />
          </zz-card>
        </div>
        <div>
          <div class="details-title">{{ $t("zz.product_superiority") }}</div>
          <div class="flex-2">
            <div
              class="flex-2-item"
              v-for="(it, index) in list2"
              :key="index"
              style="margin-bottom: 30px"
            >
              <sim-card :title="it.title" :content="it.content"></sim-card>
            </div>
          </div>
        </div>
        <div>
          <div class="details-title">{{ $t("zz.product_function") }}</div>
          <div class="flex-2">
            <div class="flex-2-item" v-for="(it, index) in list3" :key="index">
              <sim-card :title="it.title" :content="it.content"></sim-card>
            </div>
          </div>
        </div>
        <!--  -->
        <div style="min-height: 400px">
          <div class="details-title">{{ $t("zz.application_scenarios") }}</div>
          <div class="header-nav-wrapper-wrap">
            <ul class="header-nav-wrapper">
              <li
                v-for="(item, i) in list[3].child"
                :key="i"
                :class="item.index == subIndex ? 'active' : ''"
                @click="navClick(item)"
              >
                {{ item.name }}
              </li>
            </ul>
          </div>
          <div v-if="subIndex == 1">
            <zz-card>
              <div slot="content" class="card-wrap">
                <h6 class="list-title" style="margin: 0 0 20px">
                  {{ $t("zz.applicable_scene") }}
                </h6>
                <ul class="list-has-poi">
                  <li>{{ $t("zz.realTime.vod.application.use.1.1") }}</li>
                </ul>
                <h6 class="list-title" style="margin: 20px 0 20px">
                  {{ $t("zz.solution") }}
                </h6>
                <ul class="list-has-poi">
                  <li>{{ $t("zz.realTime.vod.application.fun.1.1") }}</li>
                  <li>{{ $t("zz.realTime.vod.application.fun.1.2") }}</li>
                  <li>{{ $t("zz.realTime.vod.application.fun.1.3") }}</li>
                </ul>
              </div>
              <img
                src="@/assets/img/bunchPlanting/bunchPlanting4-1.png"
                slot="img"
                alt=""
                width="390"
              />
            </zz-card>
          </div>
          <div v-if="subIndex == 2">
            <zz-card>
              <div slot="content" class="card-wrap">
                <h6 class="list-title" style="margin: 0 0 20px">
                  {{ $t("zz.applicable_scene") }}
                </h6>
                <ul class="list-has-poi">
                  <li>{{ $t("zz.realTime.vod.application.use.2.1") }}</li>
                </ul>
                <h6 class="list-title" style="margin: 20px 0 20px">
                  {{ $t("zz.solution") }}
                </h6>
                <ul class="list-has-poi">
                  <li>{{ $t("zz.realTime.vod.application.fun.2.1") }}</li>
                  <li>{{ $t("zz.realTime.vod.application.fun.2.2") }}</li>
                  <li>{{ $t("zz.realTime.vod.application.fun.2.3") }}</li>
                </ul>
              </div>
              <img
                src="@/assets/img/bunchPlanting/bunchPlanting4-2.png"
                slot="img"
                alt=""
                width="390"
              />
            </zz-card>
          </div>
          <div v-if="subIndex == 3">
            <zz-card>
              <div slot="content" class="card-wrap">
                <h6 class="list-title" style="margin: 0 0 20px">
                  {{ $t("zz.applicable_scene") }}
                </h6>
                <ul class="list-has-poi">
                  <li>{{ $t("zz.realTime.vod.application.use.3.1") }}</li>
                </ul>
                <h6 class="list-title" style="margin: 20px 0 20px">
                  {{ $t("zz.solution") }}
                </h6>
                <ul class="list-has-poi">
                  <li>{{ $t("zz.realTime.vod.application.fun.3.1") }}</li>
                  <li>{{ $t("zz.realTime.vod.application.fun.3.2") }}</li>
                  <li>{{ $t("zz.realTime.vod.application.fun.3.3") }}</li>
                </ul>
              </div>
              <img
                src="@/assets/img/bunchPlanting/bunchPlanting4-3.png"
                slot="img"
                alt=""
                width="390"
              />
            </zz-card>
          </div>
        </div>
      </div>
    </zz-sub-nav>
  </div>
</template>

<script>
import SubNav from "@/components/SubNav/index.vue";
import ZzCard from "@/components/ZzCard";
import SimCard from "@/components/SimCard";

export default {
  data() {
    return {
      index: 1,
      subIndex: 1,
    };
  },

  components: {
    "zz-sub-nav": SubNav,
    ZzCard,
    SimCard,
  },
  props: {},
  mounted() {},
  computed: {
    activeItem: function () {
      let activeItem = this.list.find((v) => v.index == this.index);
      console.log(this.list[this.index]);
      this.subIndex = activeItem.child ? activeItem.child[0].index : 1;
      return activeItem;
    },
    list: function () {
      return [
        {
          name: this.$t("zz.product_presentation"),
          index: 1,
          title: this.$t("zz.product_presentation"),
        },
        {
          name: this.$t("zz.product_superiority"),
          index: 2,
          title: this.$t("zz.product_superiority"),
        },
        {
          name: this.$t("zz.product_function"),
          index: 3,
          title: this.$t("zz.product_function"),
        },
        {
          name: this.$t("zz.application_scenarios"),
          index: 4,
          child: [
            { name: this.$t("zz.realTime.vod.app.4.1"), index: 1 },
            { name: this.$t("zz.realTime.vod.app.4.2"), index: 2 },
            { name: this.$t("zz.realTime.vod.app.4.3"), index: 3 },
          ],
        },
      ];
    },
    list2: function () {
      return [
        {
          title: this.$t("zz.realTime.vod.advantage.1.title"),
          content: this.$t("zz.realTime.vod.advantage.1.intro1"),
        },
        {
          title: this.$t("zz.realTime.vod.advantage.2.title"),
          content: this.$t("zz.realTime.vod.advantage.2.intro1"),
        },
        {
          title: this.$t("zz.realTime.vod.advantage.3.title"),
          content: this.$t("zz.realTime.vod.advantage.3.intro1"),
        },
        {
          title: this.$t("zz.realTime.vod.advantage.4.title"),
          content: this.$t("zz.realTime.vod.advantage.4.intro1"),
        },
        {
          title: this.$t("zz.realTime.vod.advantage.5.title"),
          content: this.$t("zz.realTime.vod.advantage.5.intro1"),
        },
        {
          title: this.$t("zz.realTime.vod.advantage.6.title"),
          content: this.$t("zz.realTime.vod.advantage.6.intro1"),
        },
        {
          title: this.$t("zz.realTime.vod.advantage.7.title"),
          content: this.$t("zz.realTime.vod.advantage.7.intro1"),
        },
        {
          title: this.$t("zz.realTime.vod.advantage.8.title"),
          content: this.$t("zz.realTime.vod.advantage.8.intro1"),
        },
      ];
    },
    list3: function () {
      return [
        {
          title: this.$t("zz.realTime.vod.function.1.title"),
          content: this.$t("zz.realTime.vod.function.1.intro1"),
        },
        {
          title: this.$t("zz.realTime.vod.function.2.title"),
          content: this.$t("zz.realTime.vod.function.2.intro1"),
        },
        {
          title: this.$t("zz.realTime.vod.function.3.title"),
          content: this.$t("zz.realTime.vod.function.3.intro1"),
        },
        {
          title: this.$t("zz.realTime.vod.function.4.title"),
          content: this.$t("zz.realTime.vod.function.4.intro1"),
        },
        {
          title: this.$t("zz.realTime.vod.function.5.title"),
          content: this.$t("zz.realTime.vod.function.5.intro1"),
        },
        {
          title: this.$t("zz.realTime.vod.function.6.title"),
          content: this.$t("zz.realTime.vod.function.6.intro1"),
        },
      ];
    },
  },
  watch: {},
  methods: {
    navClick(a_item) {
      console.log(a_item);
      this.subIndex = a_item.index;
    },
  },
  destroyed() {},
};
</script>
<style lang='scss' scoped>
@import "@/style/variables.scss";

.sub-nav-content {
  padding: 12px 48px;
  flex: 1;
  width: 100%;
  .pro-title {
    color: $color;
    font-size: 20px;
    padding: 20px 45px;
    border-bottom: 1px solid $border;
  }
  .pro-intro-wrap {
    padding: 30px 48px;
  }
  img {
    max-width: 100%;
  }
}
.son-pro-wrap {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  & > div {
    width: 238px;
  }
}
.pro-pailie-wrap {
  .card-wrap {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    & > div {
      width: 40%;
      margin: 0 5% 30px;
      img {
        margin-top: 0;
        width: 32px;
        margin-right: 10px;
      }
      h6 {
        font-size: 18px;
        font-weight: normal;
        line-height: 32px;
        margin: 10px 0 15px;
      }
      p {
        font-size: 14px;
        line-height: 25px;
      }
    }
  }
}
.business-wrap {
  padding: 50px 25px;
  h6 {
    font-size: 16px;
    margin: 50px 0 25px;
  }
  ul {
    padding-left: 25px;
    li {
      color: rgba(59, 59, 59, 1);
      font-size: 14px;
      line-height: 200%;
    }
  }
  p {
    font-size: 14px;
  }
}
</style>